package com.mystnihon.freeremote.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.mystnihon.freeremote.R;
import com.mystnihon.freeremote.db.table.SeedboxTable;
import com.mystnihon.freeremote.ui.fragment.AddSeedboxFragment;

public class AddSeedboxActivity extends SherlockFragmentActivity {
	public static final String SEEDBOX_DATA = "com.mystinihon.freeremote.SeedboxData";

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.activity_add_seedbox);
		setTitle(R.string.add_seedbox_title);
		Intent intent = getIntent();
		SeedboxTable sdb = (SeedboxTable) intent
				.getParcelableExtra(SEEDBOX_DATA);
		if (sdb != null) {
			Fragment frag = getSupportFragmentManager().findFragmentById(
					R.id.fr_fragment_add_seedbox);
			if (frag != null && frag instanceof AddSeedboxFragment) {

				((AddSeedboxFragment) frag).setSeedbox(sdb);
			}
		}

	}
}
